define(['./../model/project', './../model/locationPoints', './../service/loadMap'],
    function() {
        var app = angular.module('App.home');
        app.controller('detailCtrl', ['$scope', '$rootScope', '$state', '$stateParams', '$timeout', 'Project', 'LocationPoints', 'loadMap', 'allProjects', 'curPrj',
            function($scope, $rootScope, $state, $stateParams, $timeout, Project, LocationPoints, loadMap, allProjects, curPrj) {



                $rootScope.curPrj = curPrj;

                $timeout(function() {
                    $("#slides").slidesjs({
                        height: 500, //照片的高度,略有拉升
                        navigation: false,
                        pagination: false

                    });
                }, 200);

                $scope.setActiveIndex = function(index) {
                    $scope.activeIndex = index;
                };

                $scope.dates = ['2014-10-26', '2014-11-26'];
                $scope.activeIndex = 0;

                //查询所有测项的累积数据
                $rootScope.curPrj.getSummaryResult($scope.dates).then(function(allData) {
                    //全部查询完成
                    //allData就指向$rootScope.curPrj中的summaryResults
                });

            }
        ]);
    });
